package com.example.educationalsystem.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author zpc
 * @since 2022-12-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user")
@ApiModel(value="User对象", description="")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户ID自增")
    @TableId(value = "user_id", type = IdType.AUTO)
    @ExcelProperty(value = "用户唯一ID")
    private Integer userId;

    @ApiModelProperty(value = "用户名(学生为学号,教师为教师编号,管理员为姓名)")
    @TableField("user_name")
    @ExcelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "密码")
    @TableField("user_password")
    @ExcelProperty(value = "密码")
    private String userPassword;

    @ApiModelProperty(value = "电话")
    @TableField("user_phone")
    @ExcelProperty(value = "电话")
    private String userPhone;

    @ApiModelProperty(value = "邮箱")
    @TableField("user_email")
    @ExcelProperty(value = "邮箱")
    private String userEmail;

    @ApiModelProperty(value = "用户权限")
    @TableField("user_permissions")
    @ExcelProperty(value = "用户权限")
    private Integer userPermissions;

    @ApiModelProperty(value = "用户头像url")
    @TableField("user_avatar_url")
    @ExcelProperty(value = "用户头像url")
    private String userAvatarUrl;


    @ApiModelProperty(value = "用户身份")
    @TableField("user_identity")
    @ExcelProperty(value = "用户身份")
    private String userIdentity;

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

}
